﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IniHelper;
using System.Reflection;

namespace LocalConfigFactory
{
    public static class LocalConfigStarter
    {
        public static void startWindow()
        {
            Dictionary<string, List<string>> searchFields = new Dictionary<string, List<string>>();
            List<string> keys = null;

            string dllPath = Assembly.GetExecutingAssembly().Location;
            dllPath = dllPath.Substring(0, dllPath.LastIndexOf('\\'));
            IniContainer container = IniContainer.createContainer("config", dllPath);
            keys = new List<string>();
            keys.Add("WebConfig");
            searchFields.Add("WebFile", keys);
            keys = new List<string>();
            keys.Add("HandWriting");
            searchFields.Add("LocalFile", keys);
            container.load(searchFields);

            LocalConfigDialog windowReference = new LocalConfigDialog(container);
            windowReference.ShowDialog();
        }
    }
}
